package com.xbao.controller.config;

import com.aliyun.oss.OSSClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 */
@Configuration
public class OssConfig {

    public  String endpoint = "http://oss-cn-beijing.aliyuncs.com";
    @Value("${oss.accessKeyId}")
    public  String accessKeyId ;
    @Value("${oss.accessKeySecret}")
    public  String accessKeySecret;
    @Bean
    public OSSClient getClient(){
        OSSClient ossClient = new OSSClient(endpoint, accessKeyId, accessKeySecret);
        return ossClient;
    }



}
